<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>学生登陆成功</title>
    <script type="text/javascript" src="/js/jquery-1.8.3.js"></script>
    <style>
        .examdata{
            height: 50px;
        }
    </style>
</head>
<script>
    $(function () {
        //定义被调用的函数
        var getExamList = function () {
            $.ajax({
                type: 'POST',
                url: 'SuccessServlet',
                dataType: 'JSON',
                data: {
                },
                success: function (data) {
                    $("#examInfo").find("tr[class='examdata']").remove();
                    // $("#sname").html(data.student.sName);

                    $.each(data.examList, function (index, obj) {

                        var $examtr = "<tr class='examdata'>" +
                            "<td>" + obj.eId + "</td>" +
                            "<td>" + obj.eName + "</td>" +
                            "<td>" +obj.eStart+'~'+obj.eEnd + "</td>" +
                            "<td>" +obj.eTime+"分钟</td>" +
                            "<td><a href='StuExamServlet?eid="+obj.eId+"'target=\"_parent\">进入考试</a>" +
                            "</td>" +
                            "</tr>";
                        $("#examInfo").append($examtr);

                    });


                }
            });
        }
        //页面加载就执行
        getExamList();

    });
    // js事件
    function FullScreen(el) {
        var isFullscreen = document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen;
        if (!isFullscreen) { //进入全屏,多重短路表达式
            (el.requestFullscreen && el.requestFullscreen()) ||
            (el.mozRequestFullScreen && el.mozRequestFullScreen()) ||
            (el.webkitRequestFullscreen && el.webkitRequestFullscreen()) || (el.msRequestFullscreen && el.msRequestFullscreen());

        } else { //退出全屏,三目运算符
            document.exitFullscreen ? document.exitFullscreen() :
                document.mozCancelFullScreen ? document.mozCancelFullScreen() :
                    document.webkitExitFullscreen ? document.webkitExitFullscreen() : '';
        }
    }

    function toggleFullScreen(e) {
        var el = e.srcElement || e.target; //target兼容Firefox
        el.innerHTML == '点我全屏' ? el.innerHTML = '退出全屏' : el.innerHTML = '点我全屏';
        FullScreen(el);
    }


</script>
<!-- #E0FFFF -->
<body style=" background-color:	#D1EEEE">
            <table id="examInfo" width="90%" cellspacing="0" cellpadding="0" border="1px solid"
                   style="text-align: center;margin: 0px auto">
                <tr><td colspan="5" style="color: #3284AD;font-size: 40px">您需要参加的考试有</td></tr>
                <tr id="topicHead" style="height: 60px;font-size: 30px">
                    <th>编号</th>
                    <th>考试名称</th>
                    <th>考试起止时间</th>
                    <th>考试时长</th>
                    <th>考试入口</th>
                </tr>
            </table>
</body>
</html>



